\section{A Family of Multicore Power \\Models} \label{sec:model}
The discussion of \RefFigure{fig:motivation}, in \refsec{sec:intro}, suggests that overall multicore processor power is not necessarily the sum of the power of each core, treated as independent from the others.
From this observation, we propose a \emph{family} of models that does not assume independence (\refsec{sec:model:family}).
Within the family, we focus on four specific variants and compare them against the baseline, which assumes fully independent cores (\refsec{sec:model:candidates}).
We compare these in \refsec{subsec:basicmodel}.

\subsection{The Model Family}\label{sec:model:family}
\RefFigure{fig:motivation} shows that the maximum frequency among all the cores exerts a strong first-order influence on overall power.
Physically, these cores might reside on a single power domain, so that ramping up one effectively brings the entire domain to full power, even if individual cores operate at frequencies below the maximum.

As such, suppose we characterize a set of \NumCores cores, numbered 1 to \NumCores, by two parameters:
the average frequency of these cores, \AvgFreq;
and some measure of \emph{disparity} in frequency among the cores, \Disparity.

The average frequency is simply $\AvgFreq \equiv \frac{1}{\NumCores} \sum_{c=1}^{\NumCores} \Freq_c$, where $\{\Freq_1, \ldots, \Freq_\NumCores\}$ are the frequencies of the individual cores.

Regarding disparity, many definitions are possible.
Let $\MaxFreq \equiv \max_{1 \leq c \leq \NumCores} \Freq_c$ denote the maximum frequency setting of any core, and let $\MinFreq \equiv \min_{1 \leq c \leq \NumCores} \Freq_c$ be the minimum such frequency.
Then, we consider the following possible definitions of disparity:
%
\begin{itemize}
  \item \DisparityMaxAvg: The difference between the maximum frequency and the average frequency, $\MaxFreq - \AvgFreq$.
  \item \DisparityAvgMin: The difference between the average frequency and the minimum frequency, $\AvgFreq - \MinFreq$.
  \item \DisparityMaxMin: The difference between the maximum and minimum frequency, $\MaxFreq - \MinFreq$.
  \item $\StdDev$: The standard deviation among frequencies.
\end{itemize}
%
Given \AvgFreq and some choice of \Disparity, we define a family of models of multicore power having the parametric form,
%
\begin{equation}\label{eq:family}
  \PowerMC(\AvgFreq, \Disparity) \equiv a_0 + a_1\cdot\AvgFreq + a_2\cdot\AvgFreq^{k_2} + a_3\cdot\Disparity + a_4\cdot\Disparity^{k_4},
\end{equation}
%
where $\{a_0, \ldots, a_4\}$ and $\{k_2, k_4\}$ are parameters to be estimated.

\subsection{Candidate Models}\label{sec:model:candidates}
Within the family defined by \refeq{eq:family}, we are especially interested in five cases:
%
%%\begin{itemize}
%R1: $a_1=a_4=0$, i.e., $a_0 + a_2\cdot\AvgFreq^{k_2} + a_3\cdot\Disparity$
%
%R2: $a_0 + a_1\cdot\AvgFreq + a_2\cdot\AvgFreq^{k_2} + a_3\cdot\Disparity + a_4\cdot\Disparity^{k_4}$
%
%R3: $a_2=a_3=0$, i.e., $a_0 + a_1\cdot\AvgFreq + a_4\cdot\Disparity^{k_4}$
%
%R4: $a_1=a_3=0$, i.e., $a_0 + a_2\cdot\AvgFreq^{k_2} + a_4\cdot\Disparity^{k_4}$
%
%R5: $a_2=a_4=0$, i.e., $a_0 + a_1\cdot\AvgFreq + a_3\cdot\Disparity$
%%\end{itemize}

R1: $a_2=a_4=0$, i.e., $a_0 + a_1\cdot\AvgFreq + a_3\cdot\Disparity$

R2: $a_2=a_3=0$, i.e., $a_0 + a_1\cdot\AvgFreq + a_4\cdot\Disparity^{k_4}$

R3: $a_1=a_4=0$, i.e., $a_0 + a_2\cdot\AvgFreq^{k_2} + a_3\cdot\Disparity$

R4: $a_1=a_3=0$, i.e., $a_0 + a_2\cdot\AvgFreq^{k_2} + a_4\cdot\Disparity^{k_4}$

R5: $a_0 + a_1\cdot\AvgFreq + a_2\cdot\AvgFreq^{k_2} + a_3\cdot\Disparity + a_4\cdot\Disparity^{k_4}$

\noindent
We compare these against the classic multicore model, which assumes fully independent cores.
More formally, there are two specific models, one which assumes a linear dependence with speed and another which assumes polynomial dependence.

%\begin{itemize}
R6: $\PowerMC(f_1, \ldots, f_\NumCores) = a_0 + a_1\cdot\sum_{c=1}^{N} \Freq_c^{k_1}$

R7: $\PowerMC(f_1, \ldots, f_\NumCores) = a_0 + a_1\cdot\sum_{c=1}^{N} \Freq_c$
%\end{itemize}

\noindent
Fitting  $R2,R3, R4, R5$ and $R6$ requires nonlinear regression methods, whereas simple linear regression is sufficient to fit $R1$ and $R7$.

\subsection{The ``Basic Model'' and What It Implies}\label{subsec:basicmodel}
Based on extensive experiments on multiple generations of modern x86 multicore processors (see \refsec{sec:evaluation}), we chose $R1$ using the disparity measure \DisparityMaxAvg as exhibiting the best fit.
Hereafter, we will refer to this instance as the \emph{basic model}:
%
\begin{equation} \label{eq:basic}
  \PowerBasic(\AvgFreq, \DisparityMaxAvg) \equiv a_0 + a_1\cdot\AvgFreq + a_3\DisparityMaxAvg.
\end{equation}
%
Observe that the basic model is \emph{linear} in \AvgFreq and \DisparityMaxAvg. Though dynamic power is generally nonlinear in frequency, what we observe in practice on current systems, given the relatively scales of voltage and frequency settings, appears approximately linear.
%\TODO{If the following statement is accurate, please include it: Though dynamic power is generally nonlinear in frequency, what we observe in practice on current systems, given the relatively scales of voltage and frequency settings, appears approximately linear.}

Under the basic model, two different frequency settings can deliver the same throughput or performance for a given application while consuming significantly different amounts of power.
For example, consider these two different frequency distributions on eight cores, which both have an average \GHz{1.6}: $[1.6, 1.6, 1.6, $ $1.6, 1.6, 1.6, 1.6, 1.6]$ and $[1.2, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 2.0]$.
These have $\DisparityMaxAvg$ values of \GHz{0} and \GHz{0.4}, respectively.
By \refeq{eq:basic}, larger values of \DisparityMaxAvg consume more power.
The frequency distribution with the minimum $\DisparityMaxAvg=0$ defines a theoretical Pareto frontier;
frequency settings satisfying this condition will consume the least amount of power.

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.5\textwidth]{IPDPS_410_bwaves_P0_PP0_Fre}
\caption{Theoretical Pareto frontier (in red) suggested by our model. From any user specified point $F_r$, following the vertical line 1, we can reach point $A$ which can provide  the same average speed with the lowest power. The power difference between $F_r$ and $A$ is the saved power. Following the horizonal line 2, we can reach point $B$ which can provide the highest throughput (the fastest average speed) with the same power. The speed different between $B$ and $F_r$ is the increased average speed. Following line 3 we can reach point $C$ which can provide higher speed with less power than $F_r$. }
%For an average frequency of 2.2GHz, the optimal frequency distribution, denoted by A, saves up to 59\% power than the worst frequency distributions. For a power budget 31Watts, the optimal frequency distribution, denoted by B, outperforms the worst frequency distributions by up to 55\%.}
\label{fig:paretoefficiency}
\end{center}
\end{figure}

For example, consider \reffig{fig:paretoefficiency}.
This figure shows the measured power of benchmark $410.bwaves$ running on a Intel Core i7-2600K (a quad-core Sandy Bridge processor).
Our model defines the red line shown therein.
For the same average frequency, the optimal distribution saves up to $48\%$ of the power of the most power-hungry frequency distribution.
For a given power budget, the optimal frequency distribution can outperform \naive~ones by up to $37.5\%$.
If an initial frequency distribution has an average frequency and power corresponding to ``Fr'' in the figure, then our model predicts that we can save power by following the vertical line down to $A$, or improve performance  by following the horizonal line right to $B$, or balance both improvements by reaching to $C$.

% eof
